
<!-- Cloud Storage bucket partial -->
<script id="services.cloudstorage.projects.id.buckets.partial" type="text/x-handlebars-template">
    <div id="resource-name" class="list-group-item active">
        <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Information</h4>
        <div class="list-group-item-text item-margin">Project ID: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.project_id"><samp>{{project_id}}</samp></span></div>
        <div class="list-group-item-text item-margin">Creation Date: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.creation_date">{{format_date creation_date}}</span></div>
        <div class="list-group-item-text item-margin">Location: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.location"><samp>{{location}}</samp></span></div>
        <div class="list-group-item-text item-margin">Storage Class: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.storage_class"><samp>{{storage_class}}</samp></span></div>
        <div class="list-group-item-text item-margin">Logging: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.logging_enabled">{{convert_bool_to_enabled logging_enabled}}</span></div>
        <div class="list-group-item-text item-margin">Versioning: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.versioning_enabled">{{convert_bool_to_enabled versioning_enabled}}</span></div>
        <div class="list-group-item-text item-margin">Public Access Prevention: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.public_access_prevention">{{public_access_prevention}}</span></div>
        <div class="list-group-item-text item-margin">Uniform Bucket-Level Access: <span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.uniform_bucket_level_access">{{convert_bool_to_enabled uniform_bucket_level_access}}</span></div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.permissions">IAM Permissions</span></h4>
        <div class="accordion-inner">
            <ul>
                {{#each member_bindings}}
                <li><span id="cloudstorage.projects.{{@../../key}}.buckets.{{@../key}}.{{@key}}"><samp>{{@key}}</samp></span></li>
                <ul>
                    {{#each this}}
                    <li><samp>{{this}}</samp></li>
                    {{/each}}
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.acls">ACL Permissions</span></h4>
        <div class="accordion-inner">
            <ul>
                {{#each acls}}
                <li><samp>{{entity}}</samp></li>
                <ul>
                    <li><samp>{{role}}</samp></li>
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="cloudstorage.projects.{{@../key}}.buckets.{{@key}}.default_object_acls">Default Object ACL Permissions</span></h4>
        <div class="accordion-inner">
            <ul>
                {{#each default_object_acl}}
                <li><span id="cloudstorage.projects.{{@../../key}}.buckets.{{@../key}}.default_object_acl.{{@key}}.{{entity}}"><samp>{{entity}}</samp></span></li>
                <ul>
                    <li><samp>{{role}}</samp></li>
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
</script>

<script>
    Handlebars.registerPartial("services.cloudstorage.projects.id.buckets", $("#services\\.cloudstorage\\.projects\\.id\\.buckets\\.partial").html());
</script>

<!-- Single cloudstorage bucket template -->
<script id="single_cloudstorage_bucket-template" type="text/x-handlebars-template">
    {{> modal-template template='services.cloudstorage.projects.id.buckets'}}
</script>
<script>
    var single_cloudstorage_bucket_template = Handlebars.compile($("#single_cloudstorage_bucket-template").html());
</script>